package com.sky.mapper;

import com.github.pagehelper.Page;
import com.sky.annotation.AutoFill;
import com.sky.dto.DishPageQueryDTO;
import com.sky.entity.Dish;
import com.sky.enumeration.OperationType;
import com.sky.vo.DishVO;
import org.apache.ibatis.annotations.Mapper;

import java.util.HashMap;
import java.util.List;

/*菜品Mapper接口*/
@Mapper
public interface DishMapper {

    public Integer countByCategoryId(Long categoryId);

    // 加入基础字段填充注解
    @AutoFill(value = OperationType.INSERT) // 枚举类型是Insert
    public void insert(Dish dish);

    public Page<DishVO> pageQuery(DishPageQueryDTO dishPageQueryDTO);

    public Dish getById(Long id);

    void deleteById(Long id);

    public void deleteByIds(List<Long> ids);

    public Dish getDishById(Long id);

    @AutoFill(value = OperationType.UPDATE)
    public void update(Dish dish);

    public List<Dish> getByCategoryId(Dish dish);

    public List<Dish> getDishBySetmealId(Long setmealId);

    public Integer countByMap(HashMap<Object, Object> conditionMap);
}
